package org.daochong.fastdev;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import org.daochong.lang.Page;
import org.daochong.lang.PageResult;

public interface JpaOperations {

	public boolean create(Object o, Map<String, Object> extData) throws SQLException;

	public boolean createBySql(String sqlId, Map<String, Object> params) throws SQLException;

	public boolean update(Object o, Map<String, Object> extData) throws SQLException;

	public boolean updateBySql(String sqlId, Map<String, Object> params) throws SQLException;

	public boolean updateWithoutNull(Object o, Map<String, Object> extData) throws SQLException;

	public boolean delete(Object o) throws SQLException;

	public boolean deleteBySql(String sqlId, Map<String, Object> params) throws SQLException;

	public boolean exists(Object o) throws SQLException;

	public boolean existsBySql(String sqlId, Map<String, Object> params) throws SQLException;

	public Object load(Object o) throws SQLException;

	public Object loadBySql(Class<?> clazz,String sqlId, Map<String, Object> params) throws SQLException;

	public boolean save(Object o, Map<String, Object> extData) throws SQLException;

	public boolean saveBySql(String sqlId, Map<String, Object> params) throws SQLException;

	public List<?> list(Class<?> clazz) throws SQLException;

	public List<?> listBySql(String sqlId, Class<?> clazz, Map<String, Object> params) throws SQLException;

	public PageResult<?> page(Page page, Class<?> clazz) throws SQLException;

	public PageResult<?> pageBySql(Page page, String sqlId, Class<?> clazz, Map<String, Object> params)
			throws SQLException;


}
